<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" name="viewport">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <title>搜索</title>
    <link href="{G_TEMPLATES_CSS}/mobile/mSearchcomm.css" rel="stylesheet" type="text/css" />
    <link href="{G_TEMPLATES_CSS}/mobile/mSearchgoods.css" rel="stylesheet" type="text/css">
    <script src="{G_TEMPLATES_JS}/mobile/mSearchjquery190.js" language="javascript" type="text/javascript"></script>
</head>
<style>
#pageDialogBG {
    -webkit-border-radius: 5px;
    width: 255px;
    height: 45px;
    color: #fff;
    font-size: 16px;
    text-align: center;
    line-height: 45px;
}
</style>
<div id="pageDialogBG" class="pageDialogBG">
    <div class="Prompt"></div>
</div>
<body class="g-acc-bg m-site-box" fnav="2" style="zoom: 1;">
    <input name="hidSearchKey" type="hidden" id="hidSearchKey" value="iPhone">
    <!--触屏版内页头部-->
    <div class="m-block-header" id="div-header" style="display: block;">
        <strong id="m-title">搜索</strong>
        <a href="javascript:history.back();" class="m-back-arrow"><i class="m-public-icon"></i></a>
        <a href="/?/mobile/mobile" class="m-index-icon"><i class="m-public-icon"></i></a>
    </div>
    <div class="pro-s-box thin-bor-bottom search-box pos-fix-0" id="divSearch">
        <div class="box">
            <div class="border">
                <div class="border-inner"></div>
            </div>
            <div class="input-box">
                <i class="s-icon"></i>
                <input type="text" placeholder="输入“手机”试试" value="" id="txtSearch" maxlength="10">
            </div>
        </div>
        <a href="javascript:;" class="s-btn" id="btnSearch">搜索</a>
    </div>
    <script type="text/javascript">
        $('#btnSearch').click(function(){
            var keyWord = $('#txtSearch').val();
            location.href = '{WEB_PATH}/mobile/mobile/yj_search/'+keyWord;
        });
    </script>
   
    <!--搜索结果模块-->
    <div class="good-result pad-top-86" id="loadingPicBlock">
        <!--搜索有结果时-->
        <div class="goodList" style="display: block;">
            <div class="result-num thin-bor-bottom pos-fix-44" id="divResultTip" style="">
                <p>
                    共搜索到&nbsp;
                    <span class="orange" id="spCount">{wc:$res_count}</span> &nbsp;个相关商品
                </p>
            </div>
            <ul id="ulGoodsList">
                {wc:loop $shoplist $list}
                <li><a href="/?/mobile/mobile/item/{wc:$list['id']}"><span class="gList_l fl"><img src="{G_UPLOAD_PATH}/{wc:$list['thumb']}"></span></a>
                    <div class="gList_r">
                        <a href="/?/mobile/mobile/item/{wc:$list['id']}"><h3 class="gray6">(第{wc:$list['qishu']}期){wc:$list['title']}</h3></a> <em class="gray9">价值：￥{wc:$list['money']}</em>
                        <div class="gRate">
                            <div class="Progress-bar">
                                <p class="u-progress"><span style="width: {wc:$list['rate']}%;" class="pgbar"><span class="pging"></span></span>
                                </p>
                                <ul class="Pro-bar-li">
                                    <li class="P-bar01"><em>{wc:$list['canyurenshu']}</em>已参与</li>
                                    <li class="P-bar02"><em>{wc:$list['zongrenshu']}</em>总需人次</li>
                                    <li class="P-bar03"><em>{wc:$list['shenyurenshu']}</em>剩余</li>
                                </ul>
                            </div>
                            <a codeid="{wc:$list['id']}" class="add2">
                                <s></s>
                            </a>
                        </div>
                    </div>
                </li>
                {wc:loop:end}
            </ul>
        </div>
        <!--搜索无结果时-->
        <div class="null-search-wrapper" id="divNoneData" style="display: none">
            <div class="null-search-inner">
                <i class="null-search-icon"></i>
                <p class="gray9">抱歉，没有您想要的商品！</p>
            </div>
        </div>
    </div>
<script type="text/javascript">
    //添加到购物车
    $(document).on("click", '.add2', function() {
        var codeid = $(this).attr('codeid');
        $.getJSON('{WEB_PATH}/mobile/ajax/addShopCart/' + codeid + '/1', function(data) {
            if (data.code == 1) {
                addsuccess('添加失败');
            } else if (data.code == 0) {
                addsuccess('添加成功');
            }else{
                addsuccess('已购买至限购上限');
            }
            return false;
        });
    });

    function addsuccess(dat) {
                $("#pageDialogBG .Prompt").text("");
                var w = ($(window).width() - 255) / 2,
                    h = ($(window).height() - 45) / 2;
                $("#pageDialogBG").css({
                    top: h,
                    left: w,
                    opacity: 0.8
                });
                $("#pageDialogBG").stop().fadeIn(1000);
                $("#pageDialogBG .Prompt").append('<s></s>' + dat);
                $("#pageDialogBG").fadeOut(1000);
                //购物车数量
                $.getJSON('{WEB_PATH}/mobile/ajax/cartnum', function(data) {
                    $("#btnCart").append('<em>' + data.num + '</em>');
                });
            }
</script>
</body>
</html>
